using System;
using System.Collections.Generic;
using System.Text;

namespace Dracham.Network
{
    public class NetworkParameter
    {
        private String text;
        private Int32 length;

        public NetworkParameter(Object text, Int32 length) : this(text.ToString(), length) { }
        public NetworkParameter(String text, Int32 length)
        {
            this.text = text;
            this.length = length;
        }

        public Byte[] GetParameter()
        {
            Byte[] b = new Byte[this.length];
            Byte[] tb = Encoding.UTF8.GetBytes(this.text);

            for (Int32 i = 0; i < tb.Length; i++)
            {
                b[i] = tb[i];
            }

            return b;
        }
    }
}
